package book_management.operation.impl;

import book_management.book.Book;
import book_management.book.BookList;
import book_management.operation.IOperation;

public class UpdateOperation implements IOperation {
    @Override
    public void work(BookList bookList) {
        System.out.println("您现在进行的是书籍的更新操作");
        System.out.println("请输入书籍名称:");

        String name = scanner.next();
        // 需要判断当前书架上是否已经存在该书
        if (bookList.isContains(name)) {
            bookList.updateBook(name);
            System.out.println("更新成功~");
            return;
        }
        System.out.println("该书不存在！");
    }
}
